class CreateComments < ActiveRecord::Migration
  def self.up
    create_table :comments do |t|
      t.integer :id
      t.string :summary, :limit => 50, :deafult => ''
      t.text :details, :default => ''
      t.references :commentable, :polymorphic => true
      t.integer :user_id

      t.timestamps
    end

    add_index :comments, ['user_id'], :name => 'fk_comments_user'
  end

  def self.down
    drop_table :comments
  end
end
